﻿using Dyao.Book.Entity;

namespace Dyao.Book.Repository.Abstractions
{
    public interface IBookMatchSourceRepository : IDataRepository<BookMatchSourceEntity>
    {
        /// <summary>
        /// 根据书籍编号获取仓库配置
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="sourceKey">源仓库Key</param>
        /// <returns></returns>
        Task<BookMatchSourceEntity> GetEntityByBookIdAsync(string bookId, string sourceKey, CancellationToken cancellationToken);

        /// <summary>
        /// 根据书籍编号获取匹配源
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<List<BookMatchSourceEntity>> GetListByBookIdAsync(string bookId, CancellationToken cancellationToken);
    }
}
